home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / artisanProperties.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  13.2 KB  |  528 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  June 2000
  22. //  Author:            alipka 
  23. //
  24. //  Description:
  25. //
  26. //        Option tool property window for Artisan tools
  27. //
  28. //
  29. //  Procedure Name:
  30. //         artisanProperties 
  31. //
  32. //  Description:
  33. //      Initialize the option values.
  34. //
  35. //  Input Arguments:
  36. //
  37. //  Return Value:
  38. //      None.
  39. //
  40.  
  41. global proc artisanCreateBrushFrame( 
  42.     string    $parent,
  43.     string    $currTool
  44. )
  45. // 
  46. //    Description:
  47. //        Create Artisan brush options.
  48. //
  49. {
  50.     setUITemplate -pushTemplate OptionsTemplate;
  51.     setParent $parent;
  52.  
  53.     columnLayout;
  54.         separator -h 5 -style "none";
  55.  
  56.         floatSliderGrp -field true -l "Radius(U)" 
  57.             -ann "Upper brush radius limit."
  58.             -precision 4 
  59.             -min 0.0 -max 50.0 
  60.             -step 0.05 
  61.         upperRadiusSlider;
  62.  
  63.         floatSliderGrp -field true -l "Radius(L)" 
  64.             -ann "Lower brush radius limit."
  65.             -precision 4 
  66.             -min 0.0 -max 50.0 
  67.             -step 0.05 
  68.         lowerRadiusSlider;
  69.  
  70.         if ( $currTool != "artSelect" ) {
  71.             floatSliderGrp -field true -l "Opacity"
  72.                 -ann "Brush opacity."
  73.                 -precision 4 
  74.                 -min 0.0 -max 1.0 
  75.                 -step 0.05 
  76.             opacitySlider;
  77.         }
  78.  
  79.         separator -h 5 -style "none";
  80.         
  81.         rowColumnLayout -nc 7
  82.             -cw 1 100 -cw 2 35 -cw 3 35
  83.             -cw 4 35  -cw 5 35 -cw 6 35
  84.             -cs 6 10  -cw 7 60;
  85.  
  86.             text -al "right" 
  87.                  -l "Profile " 
  88.                  -ann "Stamp profiles." 
  89.                 profileText;
  90.  
  91.             symbolCheckBox -w 35 -h 36 -i "circleGaus.xpm"
  92.                 -ann "Gaussian brush." spGaussianChBx;
  93.             symbolCheckBox -w 35 -h 36 -i "circlePoly.xpm"
  94.                 -ann "Soft brush." spPolyBrushChBx;
  95.             symbolCheckBox -w 35 -h 36 -i "circleSolid.xpm"
  96.                 -ann "Solid brush." spSolidChBx;
  97.             symbolCheckBox -w 35 -h 36 -i "rect.xpm"
  98.                 -ann "Square brush." spRectBrushChBx;
  99.             symbolCheckBox -w 35 -h 36 -i "file.xpm"        
  100.                 -ann "Last image file - shape brush profile." artFileBrushChBx;
  101.  
  102.             button -l " Browse" -ann "File browser." spShapeButton; 
  103.             separator -h 5 -style "none";
  104.         setParent ..;
  105.  
  106.         separator -h 5 -style "none";
  107.         
  108.         checkBoxGrp 
  109.             -l "" -l1 "Rotate To Stroke" 
  110.             -ann "Brush alignment: path alignment or up vector."
  111.         artBrushAlignmentChkBox;
  112.     setParent ..;
  113.  
  114.     setUITemplate -popTemplate;
  115. }
  116.  
  117.  
  118. global proc artisanCreateStrokeFrame( 
  119.     string    $parent,
  120.     string    $currTool
  121. )
  122. // 
  123. //    Description:
  124. //        Create a stroke UI for all Artisan tools.
  125. //
  126. {
  127.     setUITemplate -pushTemplate OptionsTemplate;
  128.     setParent $parent;
  129.  
  130.     columnLayout -adj true;
  131.         // Projective Paint Mode checkbox.
  132.         checkBoxGrp 
  133.             -l "" -l1 "Screen Projection" 
  134.             -ann "Paint mode."
  135.         artProjectionModeChkBox;
  136.  
  137.         // Reflection
  138.         checkBoxGrp -ncb 3 -cw4 131 50 50 50
  139.             -label "Reflection"
  140.             -labelArray3 "X" "Y" "Z"
  141.             -ann "Reflection axis."
  142.         artReflectionChBox;
  143.  
  144.         separator -h 5 -style "single";
  145.         separator -h 5 -style "none";
  146.  
  147.         // Stamp Quality Sliders.
  148.         floatSliderGrp -field true -label "Stamp Spacing"
  149.             -ann "Spacing between stamps."
  150.             -precision 3 
  151.             -min 0.01 -max 10.0
  152.             -fieldMinValue 0.001 -fieldMaxValue 100.0
  153.             -v 1.0
  154.             -step 0.01
  155.         artStampSpacingSlider;
  156.  
  157.         floatSliderGrp -field true -l "Stamp Depth"
  158.             -ann "Depth of a single stamp."
  159.             -precision 3 
  160.             -min 0.01 -max 10.0
  161.             -fieldMinValue 0.001 -fieldMaxValue 100.0
  162.             -v 1.0
  163.             -step 0.01
  164.         artStampDepthSlider;
  165.  
  166.         // Make one more option for the Paint Select tool.
  167.         if ( $currTool == "artSelect" ) {
  168.             separator -h 10 -style "none";
  169.             separator -h 10 -style "single";
  170.             separator -h 10 -style "none";
  171.  
  172.             // Stroke commands.
  173.             columnLayout ;
  174.                 textFieldGrp -label "Before Stroke Cmd" 
  175.                         -cw2 135 200 
  176.                         -ann "Command executed before the stroke."
  177.                     artPreStrokeTextField;
  178.                 textFieldGrp -label "After Stroke Cmd"  
  179.                         -cw2 135 200 
  180.                         -ann "Command executed after the stroke."
  181.                     artPostStrokeTextField;
  182.                 separator -h 5 -style "none";
  183.             setParent ..;
  184.         }
  185.  
  186.  
  187.         if ( $currTool == "artAttr" ) {
  188.             checkBoxGrp 
  189.                 -label "" 
  190.                 -l1 "Update Continuously" 
  191.                 -ann "Update attribute values during a stroke." 
  192.                 artAttrInteractiveUpdate;
  193.         }
  194.  
  195.  
  196.           separator -h 10 -style "none";
  197.  
  198.     setParent ..;
  199.  
  200.     setUITemplate -popTemplate;
  201. }
  202.  
  203.  
  204. global proc artisanCreatePressureFrame( 
  205.     string    $parent,
  206.     string    $currTool
  207. )
  208. // 
  209. //    Description:
  210. //        Create a stylus pressure frame for all Arisan tools.
  211. //
  212. {
  213.     setUITemplate -pushTemplate OptionsTemplate;
  214.     setParent $parent;
  215.  
  216.     columnLayout;
  217.         // Tablet Pressure.
  218.         checkBoxGrp  
  219.             -l "" -l1 "Stylus Pressure"
  220.             -ann "Turn on/off stylus pressure."
  221.         artStylusPressureChkBox;
  222.     
  223.         // Pressure mapping.
  224.         columnLayout artPressureMappingLayout;
  225.             optionMenuGrp -l "Pressure Mapping"
  226.                 -ann "Mapping of the tablet pressure."
  227.                 artStylusPressureOpMenu;
  228.  
  229.                 menuItem -l "Opacity"   artMapOpacity;
  230.                 menuItem -l "Radius"    artMapRadius;
  231.                 menuItem -l "Both"      artMapBoth;
  232.         setParent ..;
  233.     setParent ..;
  234.  
  235.     setUITemplate -popTemplate;
  236. }
  237.  
  238.  
  239. // ============================================================
  240. // Attribute Maps.
  241. // ============================================================
  242.  
  243. proc artisanCreateImportFrame(
  244.     string $parent,
  245.     string $currTool
  246. )
  247. // 
  248. //    Description:
  249. //        Create the import attribue map options. 
  250. //
  251. {
  252.     setUITemplate -pushTemplate OptionsTemplate;
  253.     setParent $parent;
  254.  
  255.     columnLayout artImportFrameLayout;
  256.         separator -h 5 -style "none";
  257.         
  258.         // File browser.
  259.         rowColumnLayout -nc 2 
  260.                         -cs 1 52 
  261.                         -cw 1 82 
  262.                         -cw 2 110;
  263.  
  264.             text   -l "Map Name " -ann "Attribue map browser.";
  265.             button -l " Import... "    importMapBrowseButton;
  266.         setParent ..;
  267.  
  268.         separator -h 5 -style "none";
  269.  
  270.         checkBoxGrp 
  271.             -l "" 
  272.             -l1 "Reassign Attribute Maps " 
  273.         reassignMapsChkBox;
  274.  
  275.         separator -h 5 -style "none";
  276.  
  277.         frameLayout -lv false -bv false -cll true 
  278.             -cl ($currTool == "artFluidAttr") importChannelsFrame;
  279.         optionMenuGrp -l "Import Value "
  280.                 -ann "Import channel/luminance."
  281.             importMapValueMenu;
  282.             
  283.             if ( $currTool == "artAttrColorPerVertex" ) {
  284.                 menuItem -l "RGB"        artImportMenu5;
  285.                 menuItem -l "RGBA"        artImportMenu6;
  286.             }else{
  287.                 menuItem -l "Luminance"    artImportMenu0;
  288.                 menuItem -l "Alpha"        artImportMenu1;
  289.                 menuItem -l "Red"        artImportMenu2;
  290.                 menuItem -l "Green"        artImportMenu3;
  291.                 menuItem -l "Blue"        artImportMenu4;
  292.             }
  293.  
  294.             setParent ..;
  295.  
  296.         separator -h 5 -style "none";
  297.  
  298.         // Display the treshhold for Paint Select tool.
  299.         if ( $currTool == "artSelect" ) {
  300.             columnLayout;
  301.                 floatSliderGrp -field true -l "Threshold "
  302.                     -ann "Import value threshold."
  303.                     -precision 4
  304.                     -min 0.000 -max 1.0 
  305.                     -v 0.5 -step 0.05
  306.                 importThresholdSlider;
  307.             setParent ..;
  308.             separator -h 5 -style "none";
  309.         }
  310.     setParent ..;
  311.  
  312.     setUITemplate -popTemplate;
  313. }
  314.  
  315.  
  316. proc artisanCreateExportFrame(
  317.     string    $parent,
  318.     string    $currTool
  319. )
  320. // 
  321. //    Description:
  322. //        Create export attribute maps options.
  323. //
  324. {
  325.     setUITemplate -pushTemplate OptionsTemplate;
  326.     setParent $parent;
  327.  
  328.     columnLayout artExportFrameLayout ;
  329.         separator -h 5 -style "none";
  330.         rowColumnLayout -nc 2 
  331.                         -cs 1 52 
  332.                         -cw 1 82 
  333.                         -cw 2 110;
  334.  
  335.             text   -l "Map Name " -ann "Attribue map browser.";
  336.             button -l " Export... "    exportMapBrowseButton;
  337.         setParent ..;
  338.  
  339.         separator -h 5 -style "none";
  340.  
  341.         frameLayout -lv false -bv false -cll true 
  342.             -cl ($currTool == "artFluidAttr") exportChannelsFrame;
  343.         optionMenuGrp -l "Export Value "
  344.                 -ann "Export map value."
  345.             exportMapValueMenu;
  346.             menuItem -l "Luminance" artExportMenu0;
  347.             menuItem -l "Alpha"     artExportMenu1;
  348.             menuItem -l "RGB"         artExportMenu2;
  349.             menuItem -l "RGBA"         artExportMenu3;
  350.             setParent ..;
  351.  
  352.         separator -h 5 -style "none";
  353.  
  354.         optionMenuGrp -l "Image Format" 
  355.                 -ann "Attribute map image format."
  356.                 exportImageFormat;
  357.             if(`about -mac`){
  358.                 menuItem -l "TIFF"                 fileFormatMenuItem0;
  359.                 menuItem -l "SGI"                   fileFormatMenuItem1;
  360.                 menuItem -l "IFF"                 fileFormatMenuItem2;
  361.                 menuItem -l "JPEG"              fileFormatMenuItem3;
  362.                 menuItem -l "Targa"               fileFormatMenuItem4;
  363.                 menuItem -l "WindowsBitmap"     fileFormatMenuItem5;
  364.                 menuItem -l "QuickTime Image"    fileFormatMenuItem6;
  365.                 menuItem -l "QuickDraw"           fileFormatMenuItem7;
  366.                 menuItem -l "Photoshop"           fileFormatMenuItem8;
  367.                    menuItem -l "PNG"                   fileFormatMenuItem9;
  368.                    menuItem -l "MacPaint"               fileFormatMenuItem10;
  369.             }else{
  370.                 menuItem -l "GIF"        fileFormatMenuItem0;
  371.                 menuItem -l "SoftImage"    fileFormatMenuItem1;
  372.                 menuItem -l "RLA"        fileFormatMenuItem2;
  373.                 menuItem -l "TIFF"        fileFormatMenuItem3;
  374.                 menuItem -l "SGI"        fileFormatMenuItem4;
  375.                 menuItem -l "Alias"        fileFormatMenuItem5;
  376.                 menuItem -l "IFF"        fileFormatMenuItem6;
  377.                 menuItem -l "JPEG"        fileFormatMenuItem7;
  378.                 menuItem -l "EPS"        fileFormatMenuItem8;
  379.                 menuItem -l "Quantel"    fileFormatMenuItem9;
  380.             }
  381.  
  382.         separator -h 5 -style "none";
  383.  
  384.         checkBoxGrp 
  385.             -l "" 
  386.             -l1 "Keep Aspect Ratio " 
  387.         exportKeepAspectChkBox;
  388.  
  389.         separator -h 5 -style "none";
  390.  
  391.         intSliderGrp -field true -l "Map Size X" 
  392.             -ann "Size of the attribute map X."
  393.             -min 1 -max 8192 
  394.             -v 256 -ss 256
  395.         exportMapSizeXSlider;
  396.  
  397.         intSliderGrp -field true -l "Map Size Y"
  398.             -ann "Size of the attribute map Y."
  399.             -min 1 -max 8192 
  400.             -v 256 -ss 256
  401.         exportMapSizeYSlider;
  402.  
  403.         separator -h 5 -style "none";
  404.     setParent ..;
  405.  
  406.     setUITemplate -popTemplate;
  407. }
  408.  
  409.  
  410. global proc artisanCreateAttrMapFrame( 
  411.     string    $parent,
  412.     string    $currTool
  413. )
  414. // 
  415. //    Description:
  416. //        Import/Export of attribute maps properties.
  417. //
  418. {
  419.     setUITemplate -pushTemplate OptionsTemplate;
  420.     setParent $parent;
  421.  
  422.     columnLayout -adj true artisanAttrMap;
  423.  
  424.     // Import attribute map frame.
  425.     frameLayout -l " Import "
  426.         -collapsable true -collapse true 
  427.         artisanImportFrame;
  428.  
  429.         // Create the import frame.
  430.         artisanCreateImportFrame( "artisanImportFrame", $currTool );
  431.     setParent ..;
  432.  
  433.     // Only some of the tools support exporting
  434.     // of the attribute maps.
  435.     if ( ( $currTool == "artSelect" ) 
  436.     ||     ( $currTool == "artAttr" )
  437.     ||     ( $currTool == "artAttrColorPerVertex" )
  438.     ||     ( $currTool == "artFluidAttr" )
  439.     )
  440.     {
  441.         // Export attribute map frame.
  442.         frameLayout -l " Export "
  443.             -collapsable true -collapse true 
  444.             artisanExportFrame;
  445.  
  446.             // Create the import frame.
  447.             artisanCreateExportFrame( "artisanExportFrame", $currTool );
  448.         setParent ..;
  449.     }
  450.     setParent ..;        // columnLayout artisanAttrMap
  451.  
  452.     setUITemplate -popTemplate;
  453. }
  454.  
  455.  
  456. global proc artisanCreateDisplayFrame( 
  457.     string    $parent,
  458.     string    $currTool
  459. )
  460. // 
  461. //    Description:
  462. //        Display .
  463. //
  464. {
  465.     setUITemplate -pushTemplate OptionsTemplate;
  466.     setParent $parent;
  467.  
  468.     columnLayout;
  469.         checkBoxGrp -ncb 1 
  470.                 -l " "
  471.                 -l1  "Draw Outline" 
  472.                 -ann "Draw brush outline."
  473.             artDrawOutlineChkBox;
  474.  
  475.         checkBoxGrp -ncb 1 
  476.                 -l ""
  477.                 -l1  "Draw Outline while Painting" 
  478.                 -ann "Turn on/off brush feedback while painting."
  479.             artBrushWhilePaintingChkBox;
  480.  
  481.         checkBoxGrp -ncb 1 
  482.                 -l ""
  483.                 -l1  "Draw Brush Feedback" 
  484.                 -ann "Draw additional brush feedback."
  485.             artBrushFeedbackChkBox;
  486.  
  487.         checkBoxGrp -ncb 1 
  488.                 -l ""
  489.                 -l1  "Show Wireframe" 
  490.                 -ann "Draw wireframe in shaded mode."
  491.             artShowActiveLinesChkBox;
  492.  
  493.         // Support for color feedback.
  494.         if ( $currTool == "artAttr" || $currTool == "artAttrSkin" ) {
  495.             separator -h 20 -style "none";
  496.  
  497.             // Color Feedback.
  498.             checkBoxGrp -ncb 1 
  499.                     -l "" 
  500.                     -l1 "Color Feedback" 
  501.                     -ann "Color feedback switch."
  502.                 artColorFeedbackChkBox;
  503.             
  504.             separator -h 5 -style "none";
  505.  
  506.             floatSliderGrp -field true -l "Min Color" 
  507.                 -ann "Min value for color feedback display."
  508.                 -precision 4  
  509.                 -min -5.0 -max 5.0
  510.                 -step 0.1 
  511.                 -fmn -1000.0 -fmx 1000.0 
  512.               artColorFeedbackMinSlider;    // crLower
  513.  
  514.             floatSliderGrp -field true -l "Max Color" 
  515.                 -ann "Max value for color feedback display."
  516.                 -precision 4 
  517.                 -min -5.0 -max 5.0
  518.                 -step 0.1 
  519.                 -fmn -1000.0 -fmx 1000.0 
  520.             artColorFeedbackMaxSlider; // crUpper;  
  521.         }
  522.  
  523.         separator -h 5 -style "none";
  524.     setParent ..;
  525.  
  526.     setUITemplate -popTemplate;
  527. }
  528.